home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / aessrc12 / aesutgr1.s < prev    next >
Text File  |  1990-11-23  |  3KB  |  97 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* AESFAST Public Domain GEM bindings.
  5. ;*
  6. ;*  04/05/89 - v1.2
  7. ;*             Added code to insure that the line-a base pointer is in A0
  8. ;*             before calling $A00x to turn mouse on & off.  This has
  9. ;*             never been needed before, but seems to be required under
  10. ;*             TOS 1.4.  Also, for the mouse-on call, the flag value in
  11. ;*             INTIN[0] is now properly set to non-zero, to indicate that
  12. ;*             we *don't* want the mouse 'forced' on regardless of the
  13. ;*             current depth of mouse-off calls.
  14. ;*========================================================================
  15.  
  16. ;*************************************************************************
  17. ;*
  18. ;* Graphics routines 1 of n.
  19. ;*
  20. ;*************************************************************************
  21.           
  22. lineabase:dc.l      0         ; -> base addr of line-a's vars
  23. noforce:  dc.w      1         ; flag: don't 'force' mouse on for $A009 call
  24.  
  25. linea_init:
  26.           dc.w      $A000
  27.           lea       lineabase(pc),a0
  28.           move.l    d0,(a0)
  29.           rts
  30.  
  31. ;-------------------------------------------------------------------------
  32. ; graqon_mouse - Turn mouse on.
  33. ; graqof_mouse - turn mouse off.
  34. ;
  35. ;  These routines use the Line-A mouse on/off calls, and are a good bit
  36. ;  faster than graf_mouse(), but are *completely* non-standard.  They
  37. ;  are also pretty much untested. 
  38. ;
  39. ;   void graqon_mouse();
  40. ;   void graqof_mouse();
  41. ;-------------------------------------------------------------------------
  42.  
  43. _graqon_mouse::
  44.           move.l    a2,-(sp)
  45.           move.l    lineabase(pc),d0
  46.           bne.s     .initdone
  47.           bsr.s     linea_init
  48. .initdone:
  49.           move.l    d0,a0
  50.           lea       noforce(pc),a1      ; a1 -> flag indicating that mouse
  51.           move.l    a1,8(a0)            ; is not to be 'forced' on, put
  52.           dc.w      $A009               ; pointer in line-a INTIN var.
  53.           move.l    (sp)+,a2
  54.           rts
  55.  
  56. _graqof_mouse::
  57.           move.l    a2,-(sp)
  58.           move.l    lineabase(pc),d0
  59.           bne.s     .initdone
  60.           bsr.s     linea_init
  61. .initdone:
  62.           move.l    d0,a0
  63.           dc.w      $A00A
  64.           move.l    (sp)+,a2
  65.           rts
  66.  
  67. ;-------------------------------------------------------------------------
  68. ; graq_mstate -  Get mouse state (x/y/buttons) quickly, via Line-A vars.
  69. ;
  70. ;  This routine is similar to graf_mkstate() in usage, except that the
  71. ;  keyboard state is not returned.  
  72. ;
  73. ;   void graq_mstate(&mousex, &mousey, &mousebtns);
  74. ;-------------------------------------------------------------------------
  75.  
  76.  
  77. _graq_mstate::
  78.           .cargs    #4,.pmx.l,.pmy.l,.pmb.l
  79.           
  80.           move.l    lineabase(pc),d0
  81.           bne.s     .initdone
  82.           move.l    a2,-(sp)
  83.           bsr.s     linea_init
  84.           move.l    (sp)+,a2
  85. .initdone:
  86.           move.l    d0,a0
  87.           move.l    .pmx(sp),a1
  88.           move.w    -602(a0),(a1)       ; GCURX
  89.           move.l    .pmy(sp),a1
  90.           move.w    -600(a0),(a1)       ; GCURY
  91.           move.l    .pmb(sp),a1
  92.           move.w    -596(a0),(a1)       ; MOUSE_BT
  93.           rts 
  94.  
  95. ;         end of code
  96.  
  97.